package com.wuyou.single.common.enums;

import lombok.Data;

import java.util.Objects;

/**
 * 登录类型
 */
public enum LoginTypeEnum implements IEnum<String>{

    USERNAME("username", "账号登录")
    ;

    private String desc;

    private String value;

    LoginTypeEnum(String desc, String value) {
        this.desc = desc;
        this.value = value;
    }

    @Override
    public boolean matches(String value) {
        if (value == null) {
            return false;
        }
        return Objects.equals(value, getValue());
    }

    @Override
    public boolean matches(IEnum<String> iEnum) {
        if (iEnum == null) {
            return false;
        }
        return matches(iEnum.getValue());
    }

    @Override
    public String getDesc() {
        return desc;
    }

    @Override
    public String getValue() {
        return value;
    }
}
